<?php

/**
 * 旧的好好测  在我参与的页面进行展示
 */
ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\model\brand\Brand as mBrand;
use Biz\model\GoodsTestActivity\FineGoodsContentModel;
use Biz\model\GoodsTestActivity\FineGoodsModel;
use Biz\model\wiki\Wiki as mWiki;
use Biz\model\wiki\WikiBasic as mWikiBasic;
use Doraemon\model\Evaluation\Evaluation as mEvaluation;
use Doraemon\model\Evaluation\ReportRelateEvaluation as mReportRelateEvaluation;
use Doraemon\service\Evaluation;
use Doraemon\tools\ImgUpload;
use Doraemon\tools\ImgUrl;

$ids = FineGoodsModel::select('id',['type'=>FineGoodsModel::TYPE_EVALUATION_OLD]);

$content = FineGoodsContentModel::select('*',['fine_goods_id'=>$ids]);
if($content) {
    foreach ($content as $item) {
        $data = \Biz\model\GoodsTestActivity\FineGoodsJoinRecordModel::insert([
            'fine_goods_id' => $item['fine_goods_id'],
            'uid' => $item['uid']
        ]);
        var_dump($data);
    }

    $records = \Biz\model\GoodsTestActivity\FineGoodsJoinRecordModel::select('*', ['fine_goods_id' => $ids]);
    if($records) {
        foreach ($records as $value) {
            $res = \Biz\model\GoodsTestActivity\FineGoodsJoinModel::insert([
                'fine_goods_id'=>$value['fine_goods_id'],
                'record_id'=>$value['id'],
                'uid'=>$value['uid'],
                'join_status'=>\Biz\model\GoodsTestActivity\FineGoodsJoinModel::JOIN_STATUS_PREFER,
            ]);
            var_dump($res);
        }
    }
}


